/**
* 描述：人才库-详情
*/
<style lang="scss" scoped>
  @import 'src/styles/common';
  @import 'src/styles/icons';
  @import 'src/styles/company/index';
</style>
<template>
  <div class="content">
    <div class="com-main-title">
      <span class="tit">人才库</span>
      <div class="clear"></div>
      <div class="talents-detail radius05">
        <div class="title radius05">
          <i class="icon03 icon03_index01"></i>
          <i class="font">个人信息</i>
          <div class="clear"></div>
        </div>
        <div class="clear"></div>
        <div class="inner">
            <div class="talentsInfo">
              <div class="leftMain">
                <!--<span>账户名：<i>{{detailData.phone}}</i></span>-->
                <span>用户真实姓名：<i>{{detailData.name}}</i></span>
                <!--<span>信息完整度：<i>已填写简历</i></span>-->
                <span>性别：<i>{{detailData.sex | sexType}}</i></span>
                <span>手机号：<i>{{detailData.phone}}</i></span>
                <span>所在城市：<i>{{detailData.intentCityId | provinceFilter}}-{{detailData.intentCityId | cityAndType}}</i></span>
                <span>电子邮箱：<i>{{detailData.email}}</i></span>
                <span>当前就职公司：<i>{{detailData.company}}</i></span>
                <span>生日：<i>{{detailData.birth | formatDate}}</i></span>
                <!--<span>注册时间：<i>{{detailData.createdAt | formatDate}}</i></span>-->
                <div class="clear"></div>
              </div>
              <div class="rightImg">
                <!--<img src="/static/images/web/index/index01.jpg" width="170" height="170" alt="头像">-->
                <img :src="detailData.avatar?`/api/pub/image/${detailData.avatar}`:`/static/images/web/index/index01.jpg`"  width="170" height="170" alt="头像">
              </div>
              <div class="clear"></div>
              <div class="hr"></div>
              <div class="leftMain">
                <span>主修专业：<i>{{detailData.major}}</i></span>
                <div class="clear"></div>
                <span>最高学历：<i>{{detailData.education | education}}</i></span>
                <div class="clear"></div>
                <div class="clear"></div>
              </div>
              <div class="clear"></div>
              <div class="hr"></div>
              <div class="leftMain">
                <div class="clear"></div>
                <span style="margin-top: 20px;">一句话简介：</span>
                <div class="clear"></div>
              </div>
              <div class="clear"></div>
              <div class="text" v-for="item in detailData.briefIntroList">{{item}}</div>
            </div>
        </div>
        <div class="clear"></div>
        <div class="title radius05">
          <i class="icon03 icon03_index02"></i>
          <i class="font">工作经验</i>
          <div class="clear"></div>
        </div>
        <div class="clear"></div>
        <div class="inner">
            <div class="experience" v-for="item in detailData.resumeList"><!--循環这层-->
              <div class="comName">{{item.company}}</div>
              <div class="timeRanges">{{item.start | formatDate}}-{{item.end | formatDate}}</div>
              <div class="clear"></div>
              <div class="jobName"><i>{{item.job}}</i><i>{{item.salary | salaryState}}</i></div>
              <div class="clear"></div>
              <div class="info" v-for="it in item.descriptionList">{{it}}</div>
            </div>
        </div>
        <div class="title radius05">
          <i class="icon03 icon03_index03"></i>
          <i class="font">教育经历</i>
          <div class="clear"></div>
        </div>
        <div class="clear"></div>
        <div class="inner">
          <table class="edu">
            <tr>
              <td class="time">时间</td>
              <td>学校</td>
              <td>专业</td>
              <td>学历</td>
            </tr>
            <tr v-for="item in detailData.educationList">
              <td class="time">{{item.start | formatDate2}}-{{item.end | formatDate2}}</td>
              <td>{{item.school}}</td>
              <td>{{item.major}}</td>
              <td>{{item.degree | education}}</td>
            </tr>
          </table>
        </div>
      </div>
      <a class="normalBtn radius05" v-go-back>返回</a>
    </div>

  </div>
</template>
<script>
  import hyHandler from '@/components/handler/handler';
  import { getById } from '@/service/company/talentPool/talentPoolMService';
  export default {
    components: {
      hyHandler
    },
    data () {
      return {
        loading: true,
        searchData: {},
        infoShow: false,
        detailData: {}
      };
    },
    mounted () {
      const res = this.$route.query;
      this.queryDetail(res.id);
    },
    methods: {
      // 点击查看简历
      async queryDetail (id) {
        this.infoShow = true;
        let result = await getById({id: id});
        this.detailData = result.data;
        if (this.detailData.briefIntro) { // 格式化职位描述
          this.detailData.briefIntro = this.detailData.briefIntro.replace(/\n/g, ';');
          this.detailData.briefIntroList = this.detailData.briefIntro.split(';');
        }
        if (this.detailData.resumeList && this.detailData.resumeList.length) {
          this.detailData.resumeList.forEach(item => {
            let description = item.description.replace(/\n/g, ';');
            this.detailData.descriptionList = description.split(';');
          });
        }
        // console.log(this.detailData);
      },
      // 关闭新增、修改
      closeAddInfo () {
        this.infoShow = false;
      }
    }
  };
</script>
